﻿module tweetc.ApplicationSettings
open System
open System.Configuration

type ApplicationSettings() =
    inherit ApplicationSettingsBase()

    member this.ClearAllSettings() =
        this.OAuthToken <- ""
        this.OAuthTokenSecret <- ""
        this.TextColor <- ConsoleColor.Green
        this.SeparatorColor <- ConsoleColor.DarkGreen
        this.Save()

    [<UserScopedSetting>]
    member this.OAuthToken 
        with get() = string this.["oauthToken"]
        and  set(value:string) = this.["oauthToken"] <- value

    [<UserScopedSetting>]
    member this.OAuthTokenSecret 
        with get() = string this.["oauthTokenSecret"]
        and  set(value:string) = this.["oauthTokenSecret"] <- value

    [<UserScopedSetting>]
    [<DefaultSettingValueAttribute("Green")>]
    member this.TextColor 
        with get() = this.["textcolor"] :?> ConsoleColor
        and  set(value:ConsoleColor) = this.["textcolor"] <- value

    [<UserScopedSetting>]
    [<DefaultSettingValueAttribute("DarkGreen")>]
    member this.SeparatorColor 
        with get() = this.["separatorcolor"] :?> ConsoleColor
        and  set(value:ConsoleColor) = this.["separatorcolor"] <- value
